package cn.edu.sgu.www.pms.dto;

import cn.edu.sgu.www.pms.consts.CustomMessages;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class UserRegisterDTO implements Serializable {
    private static final long serialVersionUID = 18L;

    /**
     * 姓名/昵称
     */
    @NotBlank(message = "姓名/昵称" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "姓名/昵称", required = true)
    private String name;

    /**
     * 手机号
     */
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入正确的手机号")
    @ApiModelProperty(value = "手机号", required = true)
    private String phone;

    /**
     * 应用名
     */
    @ApiModelProperty(value = "应用名", required = true)
    private String service;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "用户名", required = true)
    private String username;

    /**
     * 密码
     */
    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$", message = "请输入8位以上字母和数字的混合密码")
    @ApiModelProperty(value = "密码", required = true)
    private String password;
}